package com.example.demo.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


@Component("lotSysUser.model")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Entity(name = "sysUser")
@Table(name = "sys_user")
public class SysUserModel extends Model implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	/** 性别  **/
	private String  sex;
	
	/** 登录账号  **/
	private String  loginName;
	
	/** 密码  **/
	private String  password;
	
	/** 登录密码错误次数 **/
	private int loginPassErrorCount;
	
	/** 姓名  **/
	private String  realName;
	
	/** 部门  **/
	private String  deptId;
	
	/** 邮箱  **/
	private String  email;
	
	/** 手机号码  **/
	private String  mobile;
	
	/** 是否启用  **/
	private String  isEnable;
	
	/** 生日  **/
	private Date  birthDate;
	
	/** 登陆次数  **/
	private int  loginCount;
	
	/** 站点ID  **/
	private String  siteId;
	
	/** 是否启用动态口令  **/
	private String  isCommand;
	
	/** 口令  **/
	private String  command;
	
	/** googleAuthenticator秘钥  **/
	private String  secret;
    
	/** 允许登录IP  **/
	private String allowIp;
	
	public SysUserModel(){
		super();
	}
	
    public SysUserModel(String loginName, String password) {
		super();
		this.loginName = loginName;
		this.password = password;
	}
	public SysUserModel(String sex, String loginName, String password, String realName, String deptId, String email,
			String mobile, String isEnable, Date birthDate, Integer loginCount, String siteId, String isCommand,
			String command, String secret,String allowIp) {
		super();
		this.sex = sex;
		this.loginName = loginName;
		this.password = password;
		this.realName = realName;
		this.deptId = deptId;
		this.email = email;
		this.mobile = mobile;
		this.isEnable = isEnable;
		this.birthDate = birthDate;
		this.loginCount = loginCount;
		this.siteId = siteId;
		this.isCommand = isCommand;
		this.command = command;
		this.secret = secret;
		this.allowIp=allowIp;
	}
	@Column(name = "sex")
    public String getSex() {
        return StringUtils.isBlank(sex) ? sex : sex.trim();
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    
    
    @Column(name = "login_name")
    public String getLoginName() {
        return StringUtils.isBlank(loginName) ? loginName : loginName.trim();
    }
    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }
    
    
    @Column(name = "password")
    public String getPassword() {
        return StringUtils.isBlank(password) ? password : password.trim();
    }
    public void setPassword(String password) {
        this.password = password;
    }
    

    @Column(name = "login_pass_error_count")
    public int getLoginPassErrorCount() {
		return loginPassErrorCount;
	}

	public void setLoginPassErrorCount(int loginPassErrorCount) {
		this.loginPassErrorCount = loginPassErrorCount;
	}
	

	@Column(name = "real_name")
    public String getRealName() {
        return StringUtils.isBlank(realName) ? realName : realName.trim();
    }
    public void setRealName(String realName) {
        this.realName = realName;
    }
    
    
    @Column(name = "dept_id")
    public String getDeptId() {
        return StringUtils.isBlank(deptId) ? deptId : deptId.trim();
    }
    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }
    
    
    @Column(name = "email")
    public String getEmail() {
        return StringUtils.isBlank(email) ? email : email.trim();
    }
    public void setEmail(String email) {
        this.email = email;
    }
    
    
    @Column(name = "mobile")
    public String getMobile() {
        return StringUtils.isBlank(mobile) ? mobile : mobile.trim();
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    
    
    @Column(name = "is_enable")
    public String getIsEnable() {
        return StringUtils.isBlank(isEnable) ? isEnable : isEnable.trim();
    }
    public void setIsEnable(String isEnable) {
        this.isEnable = isEnable;
    }
    
    
    @Column(name = "birth_date")
    public Date getBirthDate() {
        return birthDate;
    }
    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    
    @Column(name = "login_count")
    public int getLoginCount() {
        return loginCount;
    }
    public void setLoginCount(int loginCount) {
        this.loginCount = loginCount;
    }

    
    @Column(name = "site_id")
    public String getSiteId() {
        return StringUtils.isBlank(siteId) ? siteId : siteId.trim();
    }
    public void setSiteId(String siteId) {
        this.siteId = siteId;
    }
    
    @Column(name = "is_command")
    public String getIsCommand() {
        return StringUtils.isBlank(isCommand) ? isCommand : isCommand.trim();
    }
    public void setIsCommand(String isCommand) {
        this.isCommand = isCommand;
    }
    
    
    @Column(name = "command")
    public String getCommand() {
        return StringUtils.isBlank(command) ? command : command.trim();
    }
    public void setCommand(String command) {
        this.command = command;
    }
    
    
    @Column(name = "secret")
    public String getSecret() {
        return StringUtils.isBlank(secret) ? secret : secret.trim();
    }
    public void setSecret(String secret) {
        this.secret = secret;
    }
    
    @Column(name="allow_ip")
    public String getAllowIp() {
		return StringUtils.isBlank(allowIp) ? allowIp : allowIp.trim();
	}
	public void setAllowIp(String allowIp) {
		this.allowIp = allowIp;
	}

	@Override
	public String toString() {
		return "SysUserModel [sex=" + sex + ", loginName=" + loginName + ", password=" + password
				+ ", loginPassErrorCount=" + loginPassErrorCount + ", realName=" + realName + ", deptId=" + deptId
				+ ", email=" + email + ", mobile=" + mobile + ", isEnable=" + isEnable + ", birthDate=" + birthDate
				+ ", loginCount=" + loginCount + ", siteId=" + siteId + ", isCommand=" + isCommand + ", command="
				+ command + ", secret=" + secret + ", allowIp=" + allowIp + "]";
	}
	
	
	
	
	
	
}